package org.example.design.builder;

import org.example.bean.pojo.House;

/**
 * @author huangshen
 * @version 0
 * @description HouseDirector
 * @since 2022/1/30 20:06
 */
public class HouseDirector {

    HouseBuilder houseBuilder = null;

    // 如何处理建房流程，交给指挥者
    public House constructHouse() {
        houseBuilder.buildBasic();
        houseBuilder.buildWalls();
        houseBuilder.roofed();

        return houseBuilder.buildHouse();
    }

    /**
     * 构造器传入
     */
    public HouseDirector(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    /**
     *  setter方法传入
     */
    public void setHouseBuilder(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }
}
